package ace.module.upms.core.impl.api.impl.ext;

import ace.cmp.core.model.R;
import ace.module.common.api.annotation.ApiLocalPriority;
import ace.module.upms.api.UpmsAuthorityApi;
import ace.module.upms.core.impl.service.UmpsAuthorityService;
import java.util.Set;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;


/**
 * 菜单权限 api implements.
 *
 * @author Caspar
 *
 */
@ApiLocalPriority
@AllArgsConstructor
@Component
public class UpmsAuthorityApiImpl
    implements UpmsAuthorityApi {

  private final UmpsAuthorityService umpsAuthorityService;

  @Override
  public R<Set<String>> getByUpmsAppIdAndAccountId(Long upmsAppId, Long accountId) {
    Set<String> authorities = umpsAuthorityService.getByUpmsAppIdAndAccountId(upmsAppId, accountId);
    return R.ok(authorities);
  }
}
